home *** CD-ROM | disk | FTP | other *** search
- 0 poke646,1:poke53272,20
- 1 rem the original program is from the book: more basic computer games
- 2 rem by david h. ahl, copyright 1979 by creative computing
- 4 rem the talking technology is from software automatic mouth (s.a.m.)
- 5 rem modifications to eliza's routines and the adding of its voice are
- 6 rem by marv bero version 2.4 apr'85
- 8 rem thanks go to joe gomboc for help on integrating the talking
- 10 rem please note: eliza does not like vulgarities or being sworn at
- 100 print chr$(147):print:print:print
- 110 print" talking eliza"
- 120 print" [183][183][183][183][183][183][183][183][183][183][183][183][183]"
- 130 ifpeek(850)<>123thenprint" please wait!"
- 140 ifpeek(850)<>123then poke850,123:poke55,0:poke56,125:clr:load"+eliza",8,1
- 150 poke39438,72:poke39439,64:sys38144
- 160 poke39733,255:poke39734,255:poke39735,255
- 170 print " to end program, include the words"
- 180 print:print " 'shut up' in your response"
- 190 sa$="to end program, include the words shut up in your re sponce"
- 191 poke53270,200:sys39430:poke53271,0
- 200 rem -----initialization-----
- 210 dim s(41),r(41),n(41)
- 220 n1=41:n2=16:n3=115:rr=0
- 230 for x=1ton1+n2+n3:readz$:next x
- 240 for x=1ton1
- 250 read s(x),l:r(x)=s(x):n(x)=s(x)+l-1
- 260 next x
- 270 print" hi! i'm eliza. what's your problem?":print
- 280 sa$=" hi! i'm e lie za. what's your problum?"
- 281 poke53270,200:sys39430:poke53271,0
- 290 rem -----user input section-----
- 300 if left$(f$,12)="you continue" then print:goto830
- 310 print:input" ";i$
- 320 i$="[160]"+i$+" "
- 330 rem get rid of apostrophes
- 340 for l=1 to len(i$)
- 350 if mid$(i$,l,1)="'"theni$=left$(i$,l-1)+right$(i$,len(i$)-l):goto350
- 360 zw$="shutting up..."
- 370 ifl+7<=len(i$)thenifmid$(i$,l,7)="shut up"then39990
- 380 next l
- 390 zv$="please don't repeat yourself again!"
- 400 if i$=p$ then rr=rr+1
- 405 if rr=2then rr=0:print:printzv$:sa$=zv$:gosub39980:goto300
- 410 rem -----find keyword in i$-----
- 420 restore
- 430 s=0
- 440 for k=1 to n1
- 450 read k$
- 460 if s>0 then 500
- 470 for l=1 to len(i$)-len(k$)+1
- 480 if mid$(i$,l,len(k$))=k$ then s=k:t=l:f$=k$
- 490 nextl
- 500 nextk
- 510 if s>0 thenk=s:l=t:goto530
- 520 k=36:goto760:rem no keywords found
- 530 rem --take right part of string andconjugate it using list of strings
- 540 restore
- 550 for x=1 to n1:read z$:next x:rem skip keywords
- 560 c$=" "+right$(i$,len(i$)-len(f$)-l+1)+"[160]"
- 570 for x=1 to n2/2
- 580 read s$,r$
- 590 for l=1 to len(c$)
- 600 if l+len(s$)>len(c$) then 650
- 610 if mid$(c$,l,len(s$))<>s$ then 650
- 620 c$=left$(c$,l-1)+r$+right$(c$,len(c$)-l-len(s$)+1)
- 630 l=l+len (r$)
- 640 goto 690
- 650 if l+len(r$)>len(c$) then 690
- 660 if mid$(c$,l,len(r$))<>r$ then 690
- 670 c$=left$(c$,l-1)+s$+right$(c$,len(c$)-l-len(r$)+1)
- 680 l=l+len(s$)
- 690 next l
- 700 next x
- 710 if mid$(c$,2,1)=" " then c$=right$(c$,len(c$)-1): rem only 1 space
- 720 for l=1 to len(c$)
- 730 if mid$(c$,l,1)="!" then c$=left$(c$,l-1)+right$(c$,len(c$)-l):goto 730
- 740 next l
- 750 rem use keyword # (k) to get reply
- 760 restore
- 770 for x=1 to n1+n2:read z$:next x
- 780 for x=1 to r(k): read f$:next x:rem read right reply
- 790 r(k)=r(k)+1:ifr(k)>n(k)thenr(k)=s(k)
- 800 if right$(f$,1)<>"*" then print:print f$:sa$=f$:gosub39980:p$=i$: goto 290
- 810 print:zz$=left$(f$,len(f$)-1):printzz$;c$:sa$=zz$+" "+c$:gosub39980
- 820 p$=i$: goto 290
- 830 zy$="perhaps when you can keep a civil tongue we can try again...":printzy$
- 840 sa$=zy$:gosub39980:end
- 850 rem ---programme data keywords---
- 870 data "fuck","shit","screw you","go to hell","goddam"
- 880 data "can you","can i","you are","youre","i dont","i feel"
- 890 data "why dont you","why cant i","are you","i cant","i am","im "
- 900 data "you ","i want","what","how","who","where","when","why"
- 910 data "name","cause","sorry","dream","hello","hi ","maybe"
- 920 data " no","your ","always","think","alike","yes","friend"
- 930 data "computer","nokeyfound"
- 940 rem string data for conjugations
- 950 data " are "," am ","were ","was "
- 960 data " you "," i ","your ","my "
- 970 data " ive "," youve "," im ","youre "
- 980 data " me "," !you "," myself "," yourself "
- 990 rem replies
- 1000 data "please don't swear or curse"
- 1010 data "if you continue to swear, i'll have to end our session"
- 1020 data "you continue to swear despite my warning the session is finished!"
- 1030 data"don't you believe that i can*"
- 1040 data "perhaps you would like to be able to*"
- 1050 data "you want me to be able to*"
- 1060 data "perhaps you don't want to*"
- 1070 data "do you want to be able to*"
- 1080 data "what makes you think i am*"
- 1090 data "does it please you to believe that i am*"
- 1100 data"perhaps you would like to be*"
- 1110 data "do you sometimes wish you were*"
- 1120 data "don't you really*"
- 1130 data "why don't you*"
- 1140 data "do you wish to be able to*"
- 1150 data "does that trouble you?"
- 1160 data "tell me more about these feelings."
- 1170 data "do you often feel*"
- 1180 data "do you enjoy feeling*"
- 1190 data "do you really believe i don't*"
- 1200 data "perhaps in good time i will*"
- 1210 data "do you want me to*"
- 1220 data "do you think you should be able to*"
- 1230 data "why can't you*"
- 1240 data "why are you interested in wether or not i am*"
- 1250 data "would you prefer if i were not*"
- 1260 data "perhaps in your fantasies i am*"
- 1270 data "how do you know you can't*"
- 1280 data "have you tried?"
- 1290 data "perhaps you can now*"
- 1300 data "did you come to me because you are*"
- 1310 data "how long have you been*"
- 1320 data "do you believe it is normal to be*"
- 1330 data "do you enjoy being*"
- 1340 data "we were discussing you-- not me."
- 1350 data "oh, i*"
- 1360 data "you're not really talking about me, are you?"
- 1370 data "what would it mean to you if you got*"
- 1380 data "why do you want*"
- 1390 data "suppose you were soon to get*"
- 1400 data "what if you never got*"
- 1410 data "i sometimes also want"
- 1420 data"why do you ask?"
- 1430 data "does that question interest you?"
- 1440 data "what answer would please you the most?"
- 1450 data "what do you think?"
- 1460 data "are such questions on your mind often?"
- 1470 data "what is it that you really want to know?"
- 1480 data "have you asked anyone else?"
- 1490 data "have you asked this sort of question before?"
- 1500 data "what else comes to mind when you ask that?"
- 1510 data "names don't interest me."
- 1520 data "i don't care about names-- please go on."
- 1530 data "is that the real reason?"
- 1540 data "don't any other reasons come to mind?"
- 1550 data "does that reason explain anything else?"
- 1560 data "what other reasons might there be?"
- 1570 data "please don't apologize!"
- 1580 data "apologies aren't necessary."
- 1590 data "what feelings do you have when you apologize?"
- 1600 data "don't be so defensive!"
- 1610 data "what does that dream suggest to you?"
- 1620 data "do you dream often?"
- 1630 data "which people appear in your dreams?"
- 1640 data "are you disturbed by your dreams?"
- 1650 data "how do you do ... please state your problem."
- 1660 data "you don't seem quite certain."
- 1670 data "why the uncertain tone?"
- 1680 data "can't you be more positive?"
- 1690 data "you aren't sure?"
- 1700 data "don't you know?"
- 1710 data "are you saying no just to be negative?"
- 1720 data "you are being a bit negative."
- 1730 data "why not?"
- 1740 data "are you sure?"
- 1750 data "why no?"
- 1760 data "why are you concerned about my*"
- 1770 data "what about your own*"
- 1780 data "can you think of a specific example?"
- 1790 data "when?"
- 1800 data "what are you thinking of?"
- 1810 data "really, always?"
- 1820 data "do you really think so?"
- 1830 data "but you are not sure that you*"
- 1840 data "do you doubt that you*"
- 1850 data "in what way?"
- 1860 data "what resemblance do you see?"
- 1870 data "what does the similarity suggest to you?"
- 1880 data "what other connections do you see?"
- 1890 data "could there really be some connection?"
- 1900 data "how?"
- 1910 data "you seem quite positive."
- 1920 data "are you sure?"
- 1930 data "i see."
- 1940 data "i understand."
- 1950 data "why do you bring up the topic of freinds"
- 1960 data "do your friends worry you?"
- 1970 data "do your friends pick on you?"
- 1980 data "are you sure you have any friends?"
- 1990 data "do you impose on your friends?"
- 2000 data "perhaps your love for friends worries you."
- 2010 data "do computers worry you?"
- 2020 data "are you talking about me in partivcular?"
- 2030 data "are you frightened by machines?"
- 2040 data "why do you mention computers?"
- 2050 data "what do you think machines have to do with your problem?"
- 2060 data "don't you think that computers can help people?"
- 2070 data "what is it about machines that worries you?"
- 2080 data "say, do you have any psychological prob-lems?"
- 2090 data "what does that suggest to you?"
- 2100 data "i see."
- 2110 data "i'm not sure i understand you fully."
- 2120 data "come, come elucidate your thoughts."
- 2130 data "can you elaborate on that?"
- 2140 data "that is quite interesting."
- 2150 rem -----data to find reply-----
- 2160 data1,3,1,3,1,3,1,3,1,3,4,3,7,2,9,4,9,4,13,4,17,3,20,3,23,2,25,3,28,3,31,4
- 2170 data31,4,35,3,38,5,43,9,43,9,43,9,43,9,43,9,43,9,52,2,54,4,58,4,62,4,66,1
- 2180 data66,1,67,5,72,5,77,2,79,4,83,3,86,6,92,4,96,6,102,7,109,7
- 10000 d=peek(186):n$="eliza talk":open15,d,15,"s0:"+n$:close15:saven$,d:end
- 39980 poke53270,200:sys39430:poke53271,0:return
- 39990 print:printzw$:sa$=zw$:gosub39980
- 39991 forx=37768to49152:pokex,0:next
- 40000 fori=0to21:poke828+i,8+i:next
- 40010 ifdv<8ordv>29ordv=8then40030
- 40020 a=peek(828):b=peek(828+dv-8):poke828,b:poke828+dv-8,a
- 40030 a$="hello connect":forj=8to29:i=peek(828+j-8):ifi=14thennext
- 40040 close2:open2,i,2:close2:ifstthen40060
- 40050 close15:open15,i,15,"r0:"+a$+"="+a$:input#15,er:close15:ifer=63then40070
- 40060 next:print"[147]":poke53272,23:poke186,8:new
- 40070 q$=chr$(34):poke646,peek(53281):print"[147]":poke53272,23
- 40080 print"[147]p[207]2048,0:p[207]44,8:p[207]43,1:p[207]56,160:p[207]55,0:clr:l[207]"q$a$q$","i
- 40090 print"run:":poke631,13:poke632,13:poke198,2:new
-